package cn.lijida.weiwei.favor.modules.member.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import cn.lijida.weiwei.favor.commons.utils.ReturnT;
import cn.lijida.weiwei.favor.commons.validator.AddGroup;
import cn.lijida.weiwei.favor.modules.member.entity.FavorMember;
import cn.lijida.weiwei.favor.modules.member.service.IFavorMemberService;

/**
 * <p>
 * 成员 前端控制器
 * </p>
 *
 * @author jobob
 * @since 2019-12-28
 */
@RestController
@RequestMapping("/member/center")
public class FavorMemberController {
	
	@Autowired
	private IFavorMemberService favormemberService;
	
	@PostMapping("/register")
	public ReturnT<String> register(@RequestBody @Validated({AddGroup.class}) FavorMember member) throws Exception{
		
		favormemberService.register(member);
		
		return ReturnT.SUCCESS;
	}
}
